// components/navi/navi.js
Component({
    /**
    * 组件的属性列表
    */
    properties: {
        title: {
            type: String
        },
        first: {  //第一刊
            type: Boolean
        },
        latest: {  //最后一刊
            type: Boolean
        }
    },

    /**
    * 组件的初始数据
    */
    data: {
        left: '../images/triangle@left.png',
        disLeft: '../images/triangle.dis@left.png',
        right: '../images/triangle@right.png',
        disRight: '../images/triangle.dis@right.png'
    },

    /**
    * 组件的方法列表
    */
    methods: {
        onLeft(){
            if(!this.properties.latest){
                this.triggerEvent('left', {
                    behavior: 'next'
                }, {});
            }
        },
        onRight(){
            if (!this.properties.first) {
                this.triggerEvent('right', {
                    behavior: 'prev'
                }, {});
            }
        }
    }
})
